// +build 16x12

package board

// the margin around the real board for calculating moves
const (
	borderTop    = 2
	borderBottom = 2
	borderLeft   = 4
	borderRight  = 4
)

// GetFile returns the file of the given location.
//
// GetFile requires a valid square as input. For invalid squares
// the behaviour of this function is undefined.
func GetFile(location Square) File {
	return File(location-A1+Right*Square(A)) & 0xF

}

// GetRank returns the rank of the given location.
//
// GetRank requires a valid square as input. For invalid squares
// the behaviour of this function is undefined.
func GetRank(location Square) Rank {
	return Rank(location-A1+Up*Square(Rank1)) >> 4
}

func SameColor(sq1, sq2 Square) bool {
	return (sq1^sq2)&1 == (sq1>>4^sq2>>4)&1
}
